<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8">
    <title>导航条</title>
    <link rel="stylesheet" type="text/css" href="../../static/css/bootstrap.min.css" />
</head>
<body ng-app="myapp">
<nav class="navbar navbar-default" ng-controller="navController" ng-init="loadTopLevelCategory();checkUserStatus();">
    <div class="container-fluid">
        <div class="navbar-header">
            <a class="navbar-brand" href="#">首页</a>
        </div>
        <div class="collapse navbar-collapse" id="bs-example-navbar-collapse-1">
            <ul class="nav navbar-nav">
                <li class="active" ng-repeat="category in topCategorys">
                    <a href="#?id={{category.id}}">{{category.name}} </a>
                </li>
            </ul>
            <form class="navbar-form navbar-left">
                <div class="form-group">
                    <input type="text" class="form-control" placeholder="商品">
                </div>
                <button type="submit" class="btn btn-default">查询</button>
            </form>
            <ul class="nav navbar-nav navbar-right">
                <li ng-if="!datas.flag"><a href="2login.html">登录</a></li>
                <li ng-if="!datas.flag"><a href="3register.html">注册</a></li>
                <li ng-if="datas.flag"><a href="#">{{user.username}}</a></li>
                <li ng-if="datas.flag"><a href="#">退出</a></li>
                <li><a href="5car.html">购物车</a></li>
            </ul>
        </div><!-- /.navbar-collapse -->
    </div><!-- /.container-fluid -->
</nav>
</body>
</html>
